//
//  LAB_CropImageView.h
//  Camera
//
//  Created by Bodi on 16/8/12.
//  Copyright © 2016年 葛海一. All rights reserved.
//

#import <UIKit/UIKit.h>
@class CropLayer;

@protocol CropImageViewDelegate <NSObject>

@required
- (void)show;
//确保剪裁框在图片内部
- (void)initializeImageViewSize;
//图片移除剪裁框
- (CGPoint)handleBorderOverflow;
//图片缩放小于剪裁框
- (CGRect)handleScaleOverflowWithPoint:(CGPoint)point;

@end

#pragma mark - 剪裁图片的视图
@interface LAB_CropImageView : UIView<CropImageViewDelegate>
@property (nonatomic, strong)UIImageView *cropImage;
//  需要裁剪的图片视图
@property (nonatomic, strong)CropLayer *cropGrid;
//  裁剪是的遮罩


@end



#pragma mark - 裁剪视图的遮罩
@interface CropLayer : CALayer
@property (nonatomic, assign) CGRect clipRect;
//裁剪的范围
@property (nonatomic, strong) UIColor *bgColor;
//背景颜色
@property (nonatomic, retain)UIColor *gridColor;
//裁掉的范围格子


@end